package ads.server;

import java.net.URI;
import java.net.URISyntaxException;
import java.rmi.RemoteException;

import org.apache.log4j.Logger;

import ads.util.GameInfo;
import ads.util.PlayerInfo;

public class StartGameThread extends Thread {
	private ServerImpl server;
	private static final Logger log = Logger.getLogger(StartGameThread.class
			.getName());
	private GameInfo gameinfo;

	@Override
	public void run() {
		for (PlayerInfo playerInfo : gameinfo.getPlayers()) {
			log.info("begin game.game:" + gameinfo);
			try {
				playerInfo.getStub().beginGame(gameinfo);
			} catch (RemoteException e) {
				log.fatal("Error by Start Game of Client:" + playerInfo, e);
				e.printStackTrace();
			}
		}

	}

	public StartGameThread(ServerImpl server, GameInfo gameinfo) {
		super();
		this.server = server;
		this.gameinfo = gameinfo;
	}
}
